#ifndef SPLIT_FBX_H
#define SPLIT_FBX_H

#ifdef _WIN32
#include <windows/fbxsdk.h>
#define MKDIR(path) _mkdir(path)
#else
#include <linux/fbxsdk.h>
#endif
#include <vector>
#include <string>
#include <sstream>

using namespace std;
namespace fbxTool {
	class SplitFbx {
	protected:
		static void GetAllMeshNodes(FbxNode* node, vector<FbxNode*>& meshNodes);

		static void GetAllMeshNodes(const string& inputPath, vector<FbxNode*>& meshNodes, FbxManager*& manager, FbxScene*& scene);

		static void GenerateJsonFileList(vector<string>& files, const string& filename, const string& basePath);

		static string ExportChildFbx(vector<vector<FbxNode*>>& partitionedGroups, FbxManager* partManager, FbxScene* newScene, const string& outputPath, int index, bool useAscii = false);

		static void ReadFbx(const string& inputPath, FbxManager*& manager, FbxScene*& scene);

		virtual vector<string> Split(const string& inputPath, const string& outputPath, int numParts) = 0;
	public:
		void process(const string& inputPath, const string& outputPath, int numParts);
	};
}
#endif // !SPLIT_FBX_H
